Skip to main content

What’s New

Qrvey 8.7
Version 8.7 of the Qrvey platform is now available to customers! This version includes new features including area charts, the ability to pivot and export data, as well as numerous bug fixes and performance improvements.
Learn More
Qrvey 8.6
Version 8.6 of the Qrvey platform is now available to customers. This version includes several new feature enhancements and performance improvements.
Learn More
Required Update for 8.5.1
Attention 8.5.1 customers: for any 8.5.1 instance deployed prior to 08/05/2024, an update is required to ensure you are running the latest images.
Learn More
Qrvey 8.5
Version 8.5 (LTS) of the Qrvey platform is now available to customers. This version includes several new features and performance improvements.
Learn More
End-of-life Schedule
We've added a new article that lists the features and endpoints that have been scheduled for deprecation. All features and endpoints will be supported for (1) year after the release date of the LTS version that contains the alternative.
Learn More
Version: 8.7

Using Standardized Syntax

Standardized Syntax Mode enables you to create formulas using a standardized language rather than a specific syntax for a specific database engine. Formulas created in Standardize Syntax Mode work with any database engine supported by the Managed Connect and Live Connect features.

For general information on using the Formula Builder interface, see Overview of Formula Builder.

Create a Formula Using Standardized Syntax Mode

  1. Open the Formula Builder interface and select Standardized Syntax.

formula-builder-standardized-syntax-82

  1. Enter a name in the Formula Name box.
  2. To add a function to the formula, type it directly in the editor. A suggestion box displays with columns and functions that fit your text. You may also use the following method:
    • Under Insert Functions, select the function that you want to insert. The description box displays helpful information about the function.
    • Click Add to Formula. The formula displays in the Formula box.
  3. To add a column to the formula, type it directly in the editor. A suggestion box displays with columns and functions that fit your text. You may also use the following method:
    • Insert the cursor in the desired location in the formula.
    • Under Insert Columns, click on the column that you want to insert. The column displays in the Formula box.
  4. Continue to add functions and columns until your formula is complete. Standardized Syntax Mode provides automatic error detection features. The editor continuously evaluates formulas as you type, and it immediately notifies you of syntax errors as well as incorrect usage of data types. Hover over a highlighted error to display additional details.

Error detection in Standardized Syntax Mode

  1. Before you can use the formula, you should test it with sample data. If your formula uses correct syntax, you may display the Testing tab to test your formula. For more information, see the following section, “Testing a Formula in Standardized Syntax.”
  2. Click Save to save the formula. In Standardized Syntax Mode, the Save button is displayed on the Formula tab.

formula-builder-example-standardized-syntax

Testing a Formula in Standardized Syntax

  1. In Standardized Syntax mode, create your formula and click Testing. If the formula contains any syntax errors or incorrect usage of data types, the Testing tab is not available.

Formula Builder Testing tab

The Input box lists all the columns in the formula in JSON format, and it assigns values from the dataset to those columns.

  1. In the Input box, review the values provided and modify as needed. To obtain a new set of values from the dataset, click Randomize Data.

    Note: You can evaluate more than one set of values at a time by editing the JSON and adding another set in the columns.

  2. Click Test Formula. The output displays in the Output box. If an error occurs during formula evaluation, click See Console Output to display a detailed error response from the database engine.

  3. Click Save. The formula is ready for use. For more information, see "Using Formulas" in Overview of Formula Builder.

Syntax Reference

This section is a reference for proper syntax of formulas in Standardized Syntax mode.

Field/Column Syntax

Insert columns by using the Insert Columns dropdown, by entering the column name, or by selecting them from the Column/Function suggestion box. Columns display as pills inside the formula.

Function Syntax

Function names must be in uppercase and must be followed by a bracketed argument list. For example:

ABS(25)

Comments Syntax

You can add single-line comments to the formula that should start with //. For example:

// This is a comment

Operator Syntax

The following table lists the available operators. Note that normal operator precedence applies.

SymbolOperation
*Multiplication of two numbers.
/Division of two numbers.
+Addition of two numbers.
-Subtraction of two numbers, or negation of a number.
=Test equality of two values.
>Test if the first number is greater than the second number.
<Test if the first number is less than the second number.
>=Test if the first number is greater than or equal to the second number.
<=Test if the first number is less than or equal to the second number.
<>Test inequality of two values.
( )Evaluate the bracketed expression before applying operators to it.

Supported values

Data Types supported:

  • Numbers: including decimals and negative numbers.
  • Strings: any sequence of characters between two quotes.
  • Date time values: strings with any of these formats: "MM/DD/YYYY" or "MM/DD/YYYY HH:MM:SS".
  • Boolean: true or false values.

Supported Functions

Standardized Syntax mode supports the following functions:

Function nameTypeDescription
ABSNumericReturns the absolute value of a number.
ANDLogicalEvaluates different logical tests and returns true if all logical tests are true and false if at least one of the logical tests returns false.
CONCATENATEString/TextJoins two or more strings into one string.
DATEADDDate/TimeAdds a specific date part value to a given date. Date part allows: "Y" years, "M" months, "D" days, “H” hours, “MI” minutes and “S” seconds.
DATESUBTRACTDate/TimeSubtracts a specific date part value to a given date. Date part allows: "Y" years, "M" months, "D" days, “H” hours, “MI” minutes and “S” seconds.
DATEDIFDate/TimeCalculates the difference between two dates based on the date part requested. Date part allows: "Y" the number of complete years in the period, "M" the number of complete months in the period, "D" the number of days in the period.
DAYDate/TimeReturns the day of a date. The day is given as an integer ranging from 1 to 31.
DAYOFWEEKDate/TimeReturns a number or string representative of the weekday for a given date.
EVENNumericReturns a number rounded to the next greatest even integer.
EXPNumericReturns Euler’s number e raised to the power of a number.
HOURDate/TimeReturns the hour of a datetime value as an integer ranging from 0 to 23.
IFLogicalPerforms a logical test and returns a value based on the result. You need to set a value in case the test result is true and one if it is false.
IFSLogicalAllows different logical tests and returns the values set for the first condition equal to true.
INCLUDEString/TextReturns true if a string contains a specified sequence of characters. This function is case sensitive.
ISNULLLogicalReplaces null values with the specified replacement value.
LEFTString/TextReturns the first character or characters in a text string, based on the number of characters you specify.
LENGTHString/TextReturns the length of a string.
LOGNumericReturns the logarithm of a number to the base you specify.
LOWERString/TextConverts all the characters in a string to lowercase.
MAXNumericReturns the greater of two or more numeric or datetime values.
MIDString/TextReturns a specific number of characters from a text string. The resulting substring begins at the specified beginIndex and extends, t the right, the number of characters specified on numChars.
MILLISECONDDate/TimeReturns the millisecond of a datetime value as an integer ranging from 0 to 999.
MINNumericReturns the smaller of two or more numeric or datetime values.
MINUTEDate/TimeReturns the minute of a datetime value. The minute is given as an integer ranging from 0 to 59.
MONTHDate/TimeReturns the month of a date. The month is given as an integer ranging from 1 (January) to 12 (December).
ODDNumericReturns a number rounded to the next greatest odd integer.
ORLogicalEvaluates different logical tests and returns false if all logical tests are false and true if at least one of the logical tests returns true.
POWERNumericReturns the value of the first argument raised to the power of the second argument.
PROPERString/TextCapitalizes the first letter in a string and any other letters in the text placed next to any character other than a letter or number. Converts the rest of the letters to lowercase.
RANDOMNumericReturns a positive decimal number between 0 (inclusive) and 1 (exclusive).
REPLACEString/TextLooks for a specific sequence of characters inside a string and replaces it with a different sequence of characters. This function is case sensitive.
RIGHTString/TextReturns the last character or characters in a text string, based on the number of characters you specify.
ROUNDNumericRounds a number to a specified number of digits.
ROUNDDOWNNumericRounds a number down to a specified number of digits.
ROUNDUPNumericRounds a number up to a specified number of digits.
SECONDDate/TimeReturns the second of a datetime value. The second is given as an integer ranging from 0 to 59.
SQRTNumericReturns the positive square root of a value.
TEXTString/TextTransforms a number into a string.
TRIMString/TextRemoves all leading and trailing spaces from text.
UPPERString/TextConverts all the characters in a string to uppercase.
YEARDate/TimeReturns the year of a date. The year is given as an integer ranging from 1900 to 9999.